#ifndef LOGMODEL_H
#define LOGMODEL_H

#include <QAbstractTableModel>
#include <QTime>

class LogEntry
{
public:
    LogEntry(const QString & message);
    ~LogEntry();
    QString message;
    QTime time;

};


class LogModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    enum Columns {
        TimeColumn = 0,
        MessageColumn,
        ColumnCount
    };

    explicit LogModel(QObject *parent = 0);
    ~LogModel();
signals:

public slots:
    void log(const QString & message);

protected:
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role) const;

private:
    QList<LogEntry> m_entries;

};

#endif // LOGMODEL_H
